package com.movie.controller;

import com.movie.common.HttpResult;
import com.movie.service.CommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author Liu Jiaquan
 * @Description
 * @date 2024/8/4 16:40
 */
@RestController
@RequestMapping("/comment")
public class CommentController {

    @Autowired
    private CommentService commentService;

    @PostMapping("/delete/{cid}")
    public HttpResult<String> delete(@PathVariable("cid") Integer cid){
        int delete = commentService.delete(cid);
        if (delete>0) return HttpResult.success();
        else return HttpResult.error("删除失败!");
    }
}
